<?php
// +----------------------------------------------------------------------
// | Author: yaoyihong <510974211@qq.com>
// +----------------------------------------------------------------------

namespace app\api\logic;

use app\common\logic\LogicBase;
use \tpfcore\Core;

//use think\Validate;

class MiniProgramConsult extends ApiBase
{
    public function saveOnlineConsultant($data)
    {
        $validate = \think\Loader::validate($this->name);
        $validate_result = $validate->scene('add')->check($data);
        if (!$validate_result) {
            return [4003, $validate->getError(), []];
        }
        $result = Core::loadModel($this->name)->saveObject($data);
        if ($result) {
            return [0, '操作成功', []];
        } else {
            return [4003, '操作失败', []];
        }
    }
}